﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@model QzgfFrame.System.MenuManger.Models.SystemMenu

@*
model Tuple< QzgfFrame.System.MenuManger.Models.SystemMenu, QzgfFrame.System.RoleManger.Models.SystemRole>
@Html.TextBoxFor(m=>m.Item1.Pic)
@Html.TextBoxFor(m=>m.Item2.Rolename)
*@
          
@{
    ViewBag.Title = "Register";
}       
@using (Html.BeginForm("edit", "Permissions", FormMethod.Post, new { name = "form1", id = "form1" }))
{
    @Html.HiddenFor(m => m.Id)
    @Html.ValidationSummary(true, "Account creation was unsuccessful. Please correct the errors and try again.")
       <div>
        <table cellpadding="0" border="0" cellspacing="0" class="edittable">
            <tbody>
                <tr>
                    <td align="right" class="editcellmessage">菜单名</td>
                    <td align="right" class="editcellverify"><div class="l-verify-star">*</div></td>
                    <td align="left" class="editcell">
                    @Html.TextBoxFor(m => m.Name, new { validate = "{required:true,minlength:1}", ltype = "text" })
                </tr>
                <tr>
                    <td align="right" class="editcellmessage">图标：</td>
                    <td align="right" class="editcellverify"><div class="l-verify-star">*</div></td>
                    <td align="left" class="editcell">
                    @Html.TextBoxFor(m => m.Pic)
                    </td> 
                </tr> 
                <tr>
                    <td align="right" class="editcellmessage">键接地址：</td>
                    <td align="right" class="editcellverify"><div class="l-verify-star">*</div></td>
                    <td align="left" class="editcell">
                    @Html.TextBoxFor(m => m.Url)
                    </td> 
                </tr>
                <tr>
                    <td align="right" class="editcellmessage">排序：</td>
                    <td align="right" class="editcellverify"><div class="l-verify-star">*</div></td>
                    <td align="left" class="editcell">
                     @Html.TextBoxFor(m => m.Orderno)
                    </td> 
                </tr>
                <tr>
                    <td align="right" class="editcellmessage">父结点：</td>
                    <td align="right" class="editcellverify"><div class="l-verify-star">*</div></td>
                    <td align="left" class="editcell">
                     @Html.TextBoxFor(m => m.Father)
                    </td>
                </tr>
                <tr>
                    <td align="right" class="editcellmessage">是否菜单：</td>
                    <td align="right" class="editcellverify"><div class="l-verify-star">*</div></td>
                    <td align="left" class="editcell">
                     @Html.TextBoxFor(m => m.Ismenu)
                    </td>
                </tr>
                <tr>
                <td>
                    @Html.DropDownList("droptest", (SelectList)ViewData["DrophouseData"])
                </td>
                </tr>
            </tbody>
        </table>
    </div> 
}
    <script src="@Url.Content("~/Lib/jquery-validation/jquery.validate.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Lib/jquery-validation/messages_cn.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Lib/jquery-validation/jquery.metadata.js")" type="text/javascript"></script>
    <script type="text/javascript">
        //var CurID =  <%=CurID %>;
        var Validator = null;
        $(function () {
            //处理下拉框
            $("#droptest").ligerComboBox();
            $.metadata.setType("attr", "validate");
            $("#form1").ligerForm();
            deafultValidate($("#form1"));
            Validator = $("#form1").validate(); 
        }); 

        function f_success()
        {
           $(document).ready(function(){
                 $.ligerDialog.confirm("是否继续编辑","保存成功", function (ok)
                {
                    $.ligerDialog.closeWaitting();
                    parent.window.frames["mainframe"].f_reload();
                    if (!ok)
                    {
                        parent.window.frames["mainframe"].f_closeWindow();
                    }  
                });
            });
        }
        function f_error(message)
        {
            $(document).ready(function(){
                $.ligerDialog.error(message);
            });
        }
        function f_save()
        {
            //alert("say hello");
            
            if(!Validator.form()) return;
            $.ligerDialog.waitting("正在保存中...");
            //提交数据
            document.forms[0].submit();
        } 
    </script>
     <style type="text/css">
        .edittable .editcellmessage,.edittable .editcellverify,.edittable .editcell{ padding:4px;line-height:23px;}
        .edittable .editcellmessage{ padding-left:20px;} 
        body { font-size:12px; background:white;}
        
        fieldset {
            padding:10px;
            margin:10px;
            color:#333; 
            border:#06c dashed 1px;
        } 
        legend {
            color:#06c;
            font-weight:800; 
            background:#fff;
        } 

    </style>
